package com.punch.common.enums.order;

/**
 * @author xiaol
 * @date 2020/7/21 15:53
 * 退款
 */

public enum RefundStatusEnum {

    NONE(0, "无退款"),

    REFUND_SUCCESS(1, "已退款"),

    ON_REFUND(2, "退款中"),

    REJECT_REFUND(3, "拒绝退款");

    RefundStatusEnum(int code, String name) {
        this.code = code;
        this.name = name;
    }

    private int code;
    private String name;

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }


    public static String getName(Integer code) {
        if (code == null) {
            return "";
        }
        for (RefundStatusEnum refundStatusEnum : RefundStatusEnum.values()) {
            if (refundStatusEnum.getCode() == code) {
                return refundStatusEnum.getName();
            }
        }
        return "";
    }
}

